import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
class Agreement extends StatefulWidget {
  @override
  _AgreementState createState() => _AgreementState();
}

class _AgreementState extends State<Agreement> {
  TextStyle descTextStyle = new TextStyle(
    color: const Color(0xFF999999),
    fontSize: 12.0,
  );

  final TextStyle _lowProfileStyle = TextStyle(
    fontSize: 12.0,
    color: Color(0xFF4A4A4A),
  );
  @override
  Widget build(BuildContext context) {
    return new Container(
      padding: new EdgeInsets.all(0.0),
      child: new Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          new GestureDetector(
            onTap: () {},
            child: Text.rich(
              TextSpan(
                text: '登录即代表你同意',
                style: _lowProfileStyle,
                children: [
                  TextSpan(
                      recognizer: TapGestureRecognizer()
                        ..onTap = () {
                          print('点击了“服务条款”');
                        },
                      text: '“用户协议”',
                      style: TextStyle(color: Colors.blue)),
                  TextSpan(
                    text: '和',
                    style: _lowProfileStyle,
                  ),
                  TextSpan(
                      recognizer: TapGestureRecognizer()
                        ..onTap = () {
                          print('点击了“隐私政策”');
                        },
                      text: '“隐私政策”',
                      style: TextStyle(color:  Colors.blue)),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
